home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / DOS / DOS4301.C < prev    next >
C/C++ Source or Header  |  1994-12-17  |  466b  |  27 lines

  1. #include <errno.h>
  2. #include <sys/doscalls.h>
  3.  
  4. /*
  5. ** AH = 0x43 ; AL = 1
  6. ** CX = attr
  7. ** DS:DX name
  8. */
  9. int dos_setfattr(const char *name, int attr)
  10. {
  11.     struct REGPACK r;
  12.     struct SEGPACK sr = { GetDS(), GetES()};
  13.  
  14.     r.eax = 0x4301;
  15.     r.ecx = attr;
  16.     SET_SEG_OFF(name, sr.ds, r.edx);
  17.  
  18.     _intxr(0x21, &r, &sr);
  19.  
  20.     if (r.eflags & 1) {
  21.     _sys_doserror2errno( r.eax & 0xFFFF);
  22.     return (-1);
  23.     }
  24.     else
  25.     return (r.eax & 0xFFFF);
  26. }
  27.